<template>
  <div class="container">
    <div><el-tag>B组件，请求一个github user avatar</el-tag></div>
    <div v-loading="loading">
      <img :src="imgUrl" alt="">
    </div>
  </div>
</template>

<script>
  export default {
    data() {
      return {
        imgUrl: '',
        loading: true
      }
    },
    created() {
      this.getUrl()
    },
    methods: {
      getUrl() {
        this.$http.get('/api/users/111').then(res => {
          console.log(res)
          this.imgUrl = res.data.avatar_url
          this.loading = false
        })
      }
    }
  }
</script>

<style scoped>
  .container {
    margin-top: 10px;
    text-align: center;
  }
</style>